#include <stdio.h>
#include <iostream>
#include <cstring>
using namespace std;
 enum WEEK
{
      MON=1, TUE, WED, THU, FRI, SAT, SUN
}day;

int main()
{   
    char a[5];
    char week[7][4] = {"MON", "TUE","WED","THU","FRI","SAT", "SUN"};
    int b,c;
    scanf("%s", a);
    for (int i = 0; i < 7; i++)
    {
        if (strcmp(a,week[i])==0)
        {   c=i+1;
            break;
        }
    }
    scanf("%d", &b);
    b=((c+b)%7);
    switch(b)
        {
                
                case MON    : cout<<"MON";break;
                case TUE    : cout<<"TUE";break;
                case WED    : cout<<"WED";break;
                case THU    : cout<<"THU";break;
                case FRI    : cout<<"FRI";break;
                case SAT    : cout<<"SAT";break;
                case SUN    : cout<<"SUN";break;
        }
return 0;
}